package com.lb.design.pattern.singleton.hungry.seriable;

import java.io.Serializable;

/**
 * @author lb
 * @Title: HungrySingleton
 * @Description: 饿汉单例
 * @date 2019/03/11  20:16
 */
public class SeriableHungrySingleton implements Serializable {

    private static final SeriableHungrySingleton hungrySingleton = new SeriableHungrySingleton();

    private SeriableHungrySingleton() {

    }
    public static SeriableHungrySingleton getInstance(){
        return hungrySingleton;
    }
    private  Object readResolve(){
        return  hungrySingleton;
    }
}
